package com;

import com.zyx.config.SpringConfig;
import com.zyx.entity.Member;
import com.zyx.mapper.DbMapper;
import com.zyx.mapper.MemberMapper;
import com.zyx.vo.MemberVo;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;

import java.util.List;

@SpringJUnitConfig(SpringConfig.class)
public class Demo {
    @Autowired
    DbMapper dm;
    @Autowired
    MemberMapper mm;

    @Test
    void t1(){
        List<Member> list = mm.queryAll();
        for (Member m : list){
            System.out.println(m);
        }
    }

    @Test
    void t2(){
        List<String> list = mm.queryAllNames();
        for (String s : list){
            System.out.println(s);
        }
    }

    @Test
    void t3(){
        System.out.println(dm.tbs());
    }

    @Test
    void t4(){
        List<MemberVo> list = mm.showAll();
        for (MemberVo m : list) {
            System.out.println(m);
        }

    }
}
